home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / STRLEN.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  345 b   |  16 lines

  1. /* strlen.c  From TC Bible page 286  Use strlen to find the length of a string
  2.  in bytes, not counting the terminating null character */
  3.  
  4. #include <stdio.h>
  5. #include <string.h>
  6. main()
  7. {
  8.     size_t len;
  9.     char buf[80];
  10.     printf("Enter a string: ");
  11.     gets(buf);
  12.     len = strlen(buf);
  13.     printf("The length of the string is: %u\n", len);
  14.  
  15. }
  16.